﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;
using System.Text;

namespace MvcCreditoHipotecario
{
    public partial class Infocorp : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            string mensaje;
            var url = "http://localhost:4625/Infocorp.svc/Infocorp/" + txtDocumento.Text.Trim();
            var request = (HttpWebRequest)WebRequest.Create(url);
            var response = (HttpWebResponse)request.GetResponse();
            response.StatusCode.ToString();

            using (Stream respStream = response.GetResponseStream())
            {
                StreamReader reader = new StreamReader(respStream, Encoding.UTF8);
                mensaje = reader.ReadToEnd();
            }

            lblDeuda.Text = mensaje;
        }

       
       

       

     
    }
}